#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int ret = 0;
	scanf("%d", &ret);
	int last_num = 2 + ((ret - 1) * 3);
	int ans = ((2 + last_num) * ret ) / 2  ;
	printf("%d", ans); 

	return 0;
}